﻿@model IEnumerable<MobileSales.Model.Employees.Message>

@{
    View.Title = Strings.Messages;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Strings.Messages</h2>

<p>
    @Html.ActionLink(Strings.Compose, "Compose", null, new { @class = "icon-button add-icon" })
</p>
<table class="datatable">
    <thead>
    <tr>
        <th style="width:80px"></th>
        <th>
            @Strings.From
        </th>
        <th>
            @ModelStrings.Subject
        </th>
        <th>
            @ModelStrings.Content
        </th>
        <th>
            @Strings.Sent
        </th>
    </tr>
    </thead>
    <tbody>

@foreach (var item in Model) {
     <tr class="@(item.IsNew?"unread":"read")">
        <td>
            @Html.ActionLink(Strings.Delete, "Delete", new { id = item.Id }, new { @class = "icon-button delete-icon" })
        </td>
        <td>
            @Html.EmployeeFullName(item.SenderId)
        </td>
        <td>
            @Html.ActionLink(item.Subject, "Read", new { id=item.Id })
        </td>
        <td>
            @item.Content
        </td>
        <td>
            @String.Format("{0:g}", item.SendDate)
        </td>
    </tr>
}
</tbody>
</table>

